Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-66545

Group and issue picker functionality does not work for some letters

    XMLWordPrintable

Details

    Description

      Summary

      Words with some letters used in a group name or issue summary cause internal server error when searching for them using group picker or issue picker.

      Environment

      • Jira Server - 7.5.3 or 6.3.10 or 7.6.2 (any version of Jira with group/issue picker)

      Steps to reproduce

      1. Go to Administration -> User Management
      2. Add a group named "SİSTEM" 
      3. Execute REST request http://<JIRA_SERVER_URL>/rest/api/2/groups/picker?query=STEM

      Expected result

      A list of groups containing 'STEM' symbols are returned in JSON response.

      Actual result

      The error message is returned "{"errorMessages":["Internal server error"],"errors":{}}" .

      The server log shows the following exception stack trace

      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 7
      at java.lang.String.substring(String.java:1963)
      at com.atlassian.jira.util.DelimeterInserter.insert(DelimeterInserter.java:294)
      at com.atlassian.jira.rest.v2.issue.groups.GroupPickerResourceHelperImpl.buildMatchingHtml(GroupPickerResourceHelperImpl.java:146)
      at com.atlassian.jira.rest.v2.issue.groups.GroupPickerResourceHelperImpl.limitGroupResults(GroupPickerResourceHelperImpl.java:107)
      at com.atlassian.jira.rest.v2.issue.groups.GroupPickerResourceHelperImpl.findGroupsAsBean(GroupPickerResourceHelperImpl.java:93)
      

      Notes

      It will fail with the same error when you create an issue with Summary field having the last word with such symbols and try to search for it in an issue picker (e.g. when linking one issue to another).

      The problematic  method is DelimeterInserter.insert(String targetString, String[] terms) .

      When the length of the targetString when converted to lowercase is greater than the length of the original targetString the issue will appear.

      Workaround

      A user can modify the problematic group name to add a regular word after the word with problematic symbol. But please note that in this case in the JSON response html field will have slightly incorrect highlighting.
      For example if I have a group named BİRİM group and then query for BİRİM it will return the following:

      {"header":"Showing 1 of 1 matching groups","total":1,"groups":[{"name":"BİRİM group","html":"<b>BİRİM g</b>roup"}]}
      

      Please note that it highlights "BİRİM g" term instead of just BİRİM inside <b> tags.

       

      Attachments

        1. Capture1.PNG
          Capture1.PNG
          76 kB
        2. Capture2.PNG
          Capture2.PNG
          70 kB
        3. Capture3.png
          Capture3.png
          11 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lvysochyn@atlassian.com Leo
              Votes:
              9 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated: